package com.wn.sk.product.mqwork;

import com.wn.sk.feign.dto.OrderPayDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author yellow Docter
 * @date 2022 -11-11
 * @desc
 */
@Component
@Slf4j
public class OrderMQProduct {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void sendMsg(OrderPayDto orderPayDto){

        String exchange = "normal_order_exchange";

        String routingkey = "order.normal.key";

        rabbitTemplate.convertAndSend(exchange,routingkey,orderPayDto);
        log.info("消息发送成功....");

    }
}
